<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改国标行业')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-industry-edit" th:object="${sysGbIndustry}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">上级行业编码：</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input id="treeId" name="upIndustryCode" type="hidden" th:field="*{upIndustryCode}"/>
                    <input class="form-control" type="text" onclick="selectIndustryTree()" id="treeName" readonly="true"
                           th:field="*{parentName}">
                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">行业编码：</label>
            <div class="col-sm-8">
                <input name="industryCode" th:field="*{industryCode}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">行业名称：</label>
            <div class="col-sm-8">
                <input name="industryName" th:field="*{industryName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">级别：</label>
            <div class="col-sm-8">
                <input name="pLevel" th:field="*{pLevel}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">顺序：</label>
            <div class="col-sm-8">
                <input name="outOrder" th:field="*{outOrder}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/industry";
    $("#form-industry-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-industry-edit').serialize());
        }
    }

    /*国标行业-新增-选择父部门树*/
    function selectIndustryTree() {
        var options = {
            title: '国标行业选择',
            width: "380",
            url: prefix + "/selectIndustryTree/" + $("#treeId").val(),
            callBack: doSubmit
        };
        $.modal.openOptions(options);
    }

    function doSubmit(index, layero) {
        var body = $.modal.getChildFrame(index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        $.modal.close(index);
    }
</script>
</body>
</html>